package com.qf;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class test2 {

    @Autowired
    private RedisTemplate myRedisTemplate;
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Test
    public void demo01(){

        myRedisTemplate.opsForValue().set("mytemp1","jjj");

        String temp1 = (String) myRedisTemplate.opsForValue().get("mytemp1");
        System.out.println(temp1);



        myRedisTemplate.opsForValue().set("mytemp2","2");

        stringRedisTemplate.opsForValue().set("mytemp3","lll" );
        System.out.println(stringRedisTemplate.opsForValue().get("mytemp3"));

    }


}
